home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Interactive CD Sampler / Microsoft Interactive CD Sampler.iso / DEMOS / C_Automp / AUTOTP / IMD.CST / 00005.ls < prev    next >
Encoding:
Text File  |  1996-07-16  |  1.0 KB  |  23 lines

  1. on resetReg theStartSprite,theEndSprite
  2.   -- this handler is used to reset the registration point of a cast based on where it's
  3.   -- locH-locV are as it resides in a sprite in relationship to a locH of 320 and a locV of 240.
  4.   -- theSprite - the sprite number where the cast to be changed resides in.
  5.   if voidP(theEndSprite) then
  6.     set theSprite = theStartSprite
  7.     set tempList = []
  8.     set tempList = locList(theSprite)
  9.     set tempList = [320,240] - tempList
  10.     set theCast = the castNum of sprite theSprite
  11.     set thePoint = the regPoint of cast theCast
  12.     set the regPoint of cast theCast = (thePoint + point(getAt(tempList,1),getAt(tempList,2)))
  13.   else
  14.     repeat with theSprite = theStartSprite to theEndSprite
  15.       set tempList = []
  16.       set tempList = locList(theSprite)
  17.       set tempList = [320,240] - tempList
  18.       set theCast = the castNum of sprite theSprite
  19.       set thePoint = the regPoint of cast theCast
  20.       set the regPoint of cast theCast = (thePoint + point(getAt(tempList,1),getAt(tempList,2)))
  21.     end repeat
  22.   end if
  23. end